<%@ include file="/taglibs.jsp"%>

<fmt:message key="date.format" var="df" scope="page"/>

<head>
	<title><fmt:message key="fileList.title"/></title>
	<script type="text/javascript" src="${ctx}/scripts/checkbox.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/file_module.js"></script>
</head>

<s:set name="files" value="files" scope="request"/>
<s:form name="fileTransForm" action="transFileMgr" method="post">
    <s:select key="file.field" name="fieldId" list="fields" listKey="id" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"></s:select>
 	<s:select key="file.category" name="cateId" list="catList" listKey="value" listValue="name" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"></s:select>   

<tr>
	<td>
        <s:property value="getText('file.inputDate')"/>
    </td>
    <td>
        <s:textfield id="fromDate" name="fromDate" size="11" theme="simple"/>
        <button id="fromDateCal" type="button" class="button"> ... </button> 
        [<fmt:message key="date.format"/>]
    </td>
    	<td>
        &nbsp;&nbsp;&nbsp;&nbsp;
    </td>
	<td>
        <s:property value="getText('file.status')"/>
    </td> 
	<td>
		<s:select name="status" list="listProcessStatus" listKey="id" listValue="status" theme="simple" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
	</td>     
</tr>


<tr>
	<td><s:submit cssClass="button" name="search" value="%{getText('button.search.title')}" theme="simple" onclick="this.blur()"></s:submit></td>
	<td>
        &nbsp;
    </td>
</tr>
</s:form>

<s:form name="transferFileTransForm" action="transferTransFileMgr" method="post">
<s:set var="item_name" value="%{getText('file.item_name')}" scope="page"></s:set>
<s:set var="items_name" value="%{getText('file.items_name')}" scope="page"></s:set>
<display:table name="files" class="table" requestURI="" id="fileList" export="true" pagesize="10" >
	<display:setProperty name="paging.banner.item_name" value="${item_name}"/>
	<display:setProperty name="paging.banner.items_name" value="${items_name}"/>
	<display:column title="<input type='checkbox' id='chkAll'>">
		<input type="checkbox" name="fileIds" class="checkbox" value="${fileList[0].id}">
	</display:column>	
    <display:column property="[0].id" sortable="true" href="editFile.html" media="html" titleKey="file.id" paramId="id" paramProperty="[0].id">
    </display:column>
    <display:column property="[0].sender" sortable="true" titleKey="file.sender" escapeXml="true">
    </display:column>
    <display:column property="[0].content" sortable="true" titleKey="file.content" escapeXml="true">
    </display:column>
    <display:column sortable="true" titleKey="file.inputDate" escapeXml="true">
    	<fmt:formatDate value="${fileList[0].inputDate}" pattern="${df}"/>
    </display:column>
    <display:column property="[1].status" sortable="true" titleKey="file.status" escapeXml="true">
    </display:column>
</display:table>
<table>
                
</table>

<table>
<tr> 
	<td>
        <s:property value="getText('file.group')"/>
    </td>    
	<td>
		<s:select name="groupId" list="listGroup" listKey="id" listValue="name" theme="simple" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
	</td>
	
	<td>
        <s:property value="getText('file.user')"/>
    </td>    
	<td>
		<s:select name="userId" list="listUser" listKey="value" listValue="name" theme="simple" headerKey="%{getText('select.default.key')}" headerValue="%{getText('select.default.value')}"/>
	</td> 	
</tr>
<tr>
	
<tr>
    <td> 
		<s:submit cssClass="button" name="transfer" value="%{getText('button.file.transfer')}" theme="simple" onclick="this.blur()"></s:submit>
    </td>
</tr>
</table>
</s:form> 
<script type="text/javascript">highlightTableRows("fileList");</script>
<script type="text/javascript">
	highlightTableRows("fileList");
	new Calendar({
	    inputField: "fromDate",
	    dateFormat: "%m/%d/%Y",
	    trigger: "fromDateCal",
	    bottomBar: false,
	    onSelect: function() { this.hide(); }
	});
</script>
